<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>server_1</title>
    </head>
    <body>
        <h1>Web安全与防护技术——实验二：浏览器安全</h1>
        <h2>
            当前路径：<span id="cururl"></span>
        </h2>
        <hr>
        <h1>设置LocalStorage数据</h1>
        <script>
            document.getElementById('cururl').innerHTML = window.location.href;
            // 在localStorage中设置数据
            localStorage.setItem('userInfo', JSON.stringify({
                name: 'John',
                balance: 1000
            }));
            
            console.log('存储的数据：', localStorage.getItem('userInfo'));
        </script>
    </body>
</html>